Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Setup DVC Section #3655

Merged
merged 10 commits into from
Apr 11, 2023
Merged

Add Setup DVC Section #3655

merged 10 commits into from
Apr 11, 2023

Conversation

julieg18
Copy link
Contributor

@julieg18 julieg18 commented Apr 7, 2023

  • moves setup dvc logic from experiments section to new dvc section

Demo

Screen.Recording.2023-04-10.at.4.29.04.PM.mov

Part of #3434

@julieg18 julieg18 added the product PR that affects product label Apr 7, 2023
@julieg18 julieg18 self-assigned this Apr 7, 2023
webview/src/setup/components/Dvc.tsx Show resolved Hide resolved
webview/src/setup/components/Dvc.tsx Outdated Show resolved Hide resolved
webview/src/setup/components/Dvc.tsx Show resolved Hide resolved
@julieg18 julieg18 marked this pull request as ready for review April 10, 2023 22:09
@julieg18 julieg18 requested a review from shcheklein April 10, 2023 22:09
type: MessageFromWebviewType.INITIALIZED
})
expect(mockPostMessage).toHaveBeenCalledTimes(1)
it('should send the initialized message on first render', () => {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm assuming this test was supposed to be in App instead of Experiments.

<p>DVC needs to be setup before you can access experiments.</p>
<Button
onClick={() =>
setSectionCollapsed({
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other options could be:

  • only opening up the new section and not collapsing the current one
  • Take off buttons entirely and just reference going to other section.

Current choice is opening the section we want the user to go to and collapsing all other sections.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could hide or "grey out" the sections that are currently unavailable.

webview/src/setup/components/App.test.tsx Show resolved Hide resolved
>
<Experiments
isDvcSetup={
projectInitialized && Boolean(cliCompatible) && !needsGitCommit
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a better way to check for if DVC is setup properly?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Previously we discussed passing a "step" variable from the extension to let the webview know which screen to show. This would mean that the user could navigate between screens. Not sure how much sense that makes for the setup process.

Also, I don't think we use Boolean(variable) anywhere as opposed to !!variable. Although maybe we should turn on https://eslint.org/docs/latest/rules/no-implicit-coercion

Copy link
Member

@mattseddon mattseddon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to fix the redirects before merging.

The separation between the sections needs to be well-defined. After setup is complete I think we want to show the details of where the CLI has been located much like the tooltip that we show for the status bar item:

private getEnvDetails() {

Seeing as we have a lot more room than a tooltip and we can make things far more obvious we want to show the version of the CLI/Min required version etc as this is very useful information that we can use to get people "unstuck". We can also go in the direction of removing the toast messages and moving them into the setup screen. Toast messages are here:

>
<Experiments
isDvcSetup={
projectInitialized && Boolean(cliCompatible) && !needsGitCommit
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Previously we discussed passing a "step" variable from the extension to let the webview know which screen to show. This would mean that the user could navigate between screens. Not sure how much sense that makes for the setup process.

Also, I don't think we use Boolean(variable) anywhere as opposed to !!variable. Although maybe we should turn on https://eslint.org/docs/latest/rules/no-implicit-coercion

isPythonExtensionInstalled={isPythonExtensionInstalled}
needsGitInitialized={needsGitInitialized}
needsGitCommit={needsGitCommit}
projectInitialized={projectInitialized}
pythonBinPath={pythonBinPath}
hasData={hasData}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Q] What does hasData have to do with setting up the CLI? Isn't this for experiments only? Same question for needsGitCommit?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do data status and plots diff work or throw an error when there are no commits?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Q] What does hasData have to do with setting up the CLI? Isn't this for experiments only?

hasData is used for when the DVC section knows what to do with the Show Experiments button that appears when Setup is complete. Though we could rename the prop to make things more clear!

Same question for needsGitCommit?

Makes sense! Will move the needsGitCommit logic to Experiments.

webview/src/setup/components/Dvc.tsx Outdated Show resolved Hide resolved
studio: true
})
}
text="Show Experiments"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[C] As well as having the button I think we would want to close the section and open the other ones when "setup completes".

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea! Though not sure how to implement it. I thought I could do this with an effect hook, but that breaks SETUP_SHOW_STUDIO and SETUP_SHOW_EXPERIMENTS. Will put some more thought into this one and do it in a followup!

<p>DVC needs to be setup before you can access experiments.</p>
<Button
onClick={() =>
setSectionCollapsed({
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could hide or "grey out" the sections that are currently unavailable.

@julieg18
Copy link
Contributor Author

Thanks for the reviews, everyone!

What's Left To Do:

All of these items are going to be in separate prs since they are going to require extra reviews. I'm currently working on the first one, but I think we're good to merge! Will wait a bit to make sure there are no objections :)

@codeclimate
Copy link

codeclimate bot commented Apr 11, 2023

Code Climate has analyzed commit 3eaf979 and detected 1 issue on this pull request.

Here's the issue category breakdown:

Category Count
Complexity 1

The test coverage on the diff in this pull request is 100.0% (85% is the threshold).

This pull request will bring the total coverage in the repository to 94.9% (0.0% change).

View more on Code Climate.

@julieg18 julieg18 merged commit 0d8f1db into main Apr 11, 2023
@julieg18 julieg18 deleted the add-setup-dvc-section branch April 11, 2023 19:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
product PR that affects product
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants